<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>attr</title>
    <script src="../../js/jquery.1.8.3.min.js"></script>
    <script>
        $(function () {
          var src =  $("img").attr("src");
          console.log("获取到的图片路径是："+ src);

        $("#btn1").click(function () {
            console.log("单击事件。。。。");
            $("img").attr("src","../../img/timg1.jpg");
        });

            $("#btn2").click(function () {
                console.log("单击事件。。。。");
                $("img").attr("src","../../img/eight.jpg");
            });

            $("#btn3").click(function () {
                console.log("单击事件。。。。");
                $("img").attr("src","../../img/nine.jpg");
            });

            $("#btn4").click(function () {
                console.log("单击事件。。。。");
               var src = $("img").attr("src");
               alert(src);
            });


            $("#btn5").click(function () {
                console.log("单击事件。。。。");
                $("img").removeAttr("src");
            });
        })
    </script>
</head>
<body>
    <img src="../../img/timg.jpg"/>
    <button id="btn1">枫叶</button>
    <button id="btn2">8</button>
    <button id="btn3">9</button>
    <button id="btn4">获取值</button>
    <button id="btn5">移除属性</button>
</body>
</html>